package com.gmp.rooms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.Collections;
import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gmp.rooms.mapper.RoomsMapper;
import com.gmp.rooms.domain.Rooms;
import com.gmp.rooms.service.IRoomsService;

/**
 * 厂房信息目录Service业务层处理
 *
 * @author Koi
 * @date 2025-07-28
 */
@Service
public class RoomsServiceImpl extends ServiceImpl<RoomsMapper, Rooms> implements IRoomsService {
    @Autowired
    private RoomsMapper roomsMapper;

    /**
     * 查询厂房信息目录
     *
     * @param id 厂房信息目录主键
     * @return 厂房信息目录
     */
    @Override
    public Rooms selectRoomsById(String id) {
        return roomsMapper.selectRoomsById(id);
    }

    /**
     * 查询厂房信息目录列表
     *
     * @param rooms 厂房信息目录
     * @return 厂房信息目录
     */
    @Override
    public List<Rooms> selectRoomsList(Rooms rooms) {
        return roomsMapper.selectRoomsList(rooms);
    }

    /**
     * 新增厂房信息目录
     *
     * @param rooms 厂房信息目录
     * @return 结果
     */
    @Override
    public int insertRooms(Rooms rooms) {
            return roomsMapper.insertRooms(rooms);
    }

    /**
     * 修改厂房信息目录
     *
     * @param rooms 厂房信息目录
     * @return 结果
     */
    @Override
    public int updateRooms(Rooms rooms) {
        return roomsMapper.updateRooms(rooms);
    }

    /**
     * 批量删除厂房信息目录
     *
     * @param ids 需要删除的厂房信息目录主键
     * @return 结果
     */
    @Override
    public int deleteRoomsByIds(String[] ids) {
        return roomsMapper.deleteRoomsByIds(ids);
    }

    /**
     * 删除厂房信息目录信息
     *
     * @param id 厂房信息目录主键
     * @return 结果
     */
    @Override
    public int deleteRoomsById(String id) {
        return roomsMapper.deleteRoomsById(id);
    }

    /**
     * 根据roomId查询roomName
     *
     * @param roomId roomId
     * @return roomName
     */
    @Override
    public String selectRoomNameByRoomId(String roomId) {
        return roomsMapper.selectRoomNameByRoomId(roomId);
    }

    /**
     * 查询所有厂房数据
     *
     * @return list
     */
    @Override
    public List<Rooms> findAll() {
        return selectRoomsList(null);
    }
}
